import httpInstance from "@/utils/http"

export const addAddressAPI = (data) => {
    return httpInstance({
        url: "/address/add",
        method: "POST",
        data: data

    })
}

export const getAddressesAPI = () => {
    return httpInstance({
        url: "/address/list"
    })
}

export const deleteAddressAPI = (id) => {
    return httpInstance({
        url: `/address/delete/${id}`
    })
}

export const setDefaultAddressAPI = (id) => {
    return httpInstance({
        url: `/address/default/${id}`
    })
}

export const updateAddressAPI = (data) => {
    return httpInstance({
        url: "/address/update",
        method: "PUT",
        data: data
    })
}
